package communication.definitions;

/**
 * The enumerated type representing functions which can be send to and executed
 * on the robot.
 * 
 * @author Peter Kalauskas
 */
public enum TransmitableFunction implements Function {
	// Robot
	START_ROBOT(0), HALT_ROBOT(0),
	// Sensor
	REQUEST_VALUE(0);

	private int args;

	/**
	 * Constructor for the a <code>TransmitableFunction</code>
	 * 
	 * @param args
	 *            the number of arguments this function expects.
	 */
	TransmitableFunction(int args) {
		this.args = args;
	}

	/**
	 * Returns the number of expected arguments.
	 * 
	 * @return the number of expected arguments.
	 */
	public int arguments() {
		return args;
	}

	/**
	 * Returns a byte for this TransmitableFunction.
	 * 
	 * @return the byte corresponding to this TransmitableFunction
	 */
	public byte byteValue() {
		return (byte) ordinal();
	}
}
